/*
 * @Author: AskMeWhy
 * @Date: 2020-12-27 11:58:47
 * @Last Modified by: AskMeWhy
 * @Last Modified time: 2021-02-05 11:19:57
 */
const app = getApp();
const { AskComponent } = app._require("common/index");

AskComponent({
    properties: {
        item: {
            type: Object,
            value: {},
        },
        index: {
            type: Number,
            value: 0,
        },
    },
    data: {},
    lifetimes: {
        attached() {
            // 在组件实例进入页面节点树时执行
            // let pageList = getCurrentPages();
            // this.setData({
            //     active: "/" + pageList[pageList.length - 1].route,
            // });
        },
        detached() {
            // 在组件实例被从页面节点树移除时执行
        },
    },
    methods: {
        handleClick(e) {
            let { item } = e.currentTarget.dataset;
            this.$emit("click", { value: this.data.item });
        },
    },
});
